<template>
	<view v-if="showPage">
		<view class="account_message">
			<view class="shopName" v-if="newShowShopName">
				<label>店铺名称：</label>
				<text>{{AuditStatus.nickname}}</text>
			</view>
			<view class="account">
				<label>后台账号：</label>
				<text>{{AuditStatus.username}}</text>
			</view>
			<!-- <view class="password">
				<label>后台密码：</label>
				<text>{{AuditStatus.password}}</text>
			</view> -->
			<view class="url">
				<label>后台网址：</label>
				<text>{{backendUrl}}</text>
				<button @click="urlCopy">复制</button>
			</view>
			<view class="status">
				<label>审核状态：</label>
				<text style="color:#f2526f">{{newStatus}}</text>
			</view>
			<view class="reasonFailure" v-if="newShowReasonFailure">
				<label>失败原因：</label>
				<view class="richText"><rich-text :nodes="reasonFailure"></rich-text></view>
			</view>
			<view class="ImproveMessage">
				<button @click="statusEdit">{{newStatusButton}}</button>
			</view>
		</view>
		<view class="Precautions" v-if="showNoticeItem">
			<text class="Precautions_title">注意事项：</text>
			<view class="Precautions_item">
				<text>一、完善信息</text>
				<text>商家可以直接使用后台账号进行管理，但必须完善信息后，商品才可发布上线。</text>
			</view>
			<view class="Precautions_item">
				<text>二、商家提现</text>
				<text>用户支付成功后，金额先进入公司管理后台（公司能提供接口），商家后台可看见具体金额、金额明细，商家提现金额规则：每次提现周期不可 </text>
			</view>
			<view class="Precautions_item">
				<text>三、审核</text>
				<text>商家完善信息后，公司进行审核，审核结果将于三天内以已短信或者电话的形式通知，也可直接登录进行查看，审核通过后，商品便可发布上线</text>
			</view>
			<view class="Precautions_item">
				<text>四、特别声明</text>
				<text>公司只负责开店服务和技术服务，商家其他一切责任与公司无关。</text>
			</view>
		</view>
		<view class="Precautions" v-if="!showNoticeItem">
			<text class="Precautions_title">注意事项：</text>
			<view class="Precautions_item">
				<rich-text :nodes="noticeItem"></rich-text>
			</view>
		</view>
		<!-- 广告 -->
		<view class="AD">
			<text>技术支持：</text>
			<image src="../../../../static/images/log_03.png" style="width:30upx;height:24upx"></image>
			<text>掌邦科技</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				backendUrl:"www.qianxun.zanboon.com",
				AuditStatus:"",
				username:"",
				password:"",
				nickname:"",
				newStatus:"",
				reasonFailure:"",
				newStatusButton:"",
				newShowReasonFailure:false,
				showNoticeItem:true,
				noticeItem:"",
				showPage:false
			}
		},
		methods: {
			statusEdit(){
				if(this.newStatus=="审核进行中"||this.newStatus=="审核成功"){
					uni.navigateTo({
						url:"../viewInformation/viewInformation"
					})
				}else{
					uni.navigateTo({
						url:"../improveMessage/improveMessage"
					})
				}
			},
			urlCopy(){
				uni.setClipboardData({
				 data: this.backendUrl,
				 success: function () {
				   uni.showToast({
				   	title:"已复制后台网址",
					duration:1000,
				   })
				 }
				});
			},
			getAuditStatus(){
				//数据加载提示框
				uni.showLoading({
					title: '拼命加载中',
					mask: true
				});
				let that=this;
				let URL=this.$store.state.URL
				let token=this.$store.state.token
				let merchantToken=this.$store.state.merchantToken
				uni.request({
					url:URL+"/merchant/merchant/show_auditStatus",
					data:{
						token:merchantToken,
					},
					method:"GET",
					success(res) {
						console.log(res);
						uni.hideLoading();
						that.AuditStatus=res.data.data;
						//审核成功
						if(that.AuditStatus.auditStatus=="P"){
							that.newStatus="审核成功";
							that.newStatusButton="查看信息"
							that.newShowReasonFailure=false;
						}
						//审核失败
						if(that.AuditStatus.auditStatus=="F"){
							that.newStatus="审核失败";
							that.newStatusButton="完善信息";
							that.newShowReasonFailure=true;
							that.reasonFailure=that.AuditStatus.noticeItem;
						}
						//审核进行中
						if(that.AuditStatus.auditStatus=="A"){
							that.newStatus="审核进行中";
							that.newStatusButton="查看信息";
							that.newShowReasonFailure=false;
						}
						//未审核
						if(that.AuditStatus.auditStatus=="U"){
							that.newStatus="未进行审核";
							that.newStatusButton="添加信息";
							that.newShowReasonFailure=false;
						}
						uni.request({
							url:URL+"/system/configuration_info/attention",
							data:{
								token:token
							},
							success(res) {
								if(res.data.status==true){
									that.showNoticeItem=false
									that.noticeItem=res.data.msg.noticeItem
									that.showPage=true
								}else{
									that.showNoticeItem=true
								}
							}
						})
					}
				})
			},
		},
		onLoad(options) {
		    // this.getAuditStatus();
			console.log(this.$store.state.merchantToken);
		},
		computed:{
			
		},
		onShow(){
			 this.getAuditStatus();
		}
	}
</script>

<style>
 page{
	 background:#F5F5F5;
 }
 .account_message{
	 width:95%;
	 height:auto;
	 background:#fff;
	 border-radius: 30upx;
	 margin:20upx auto;
	 text-align: center;
	 padding:30upx 0;
 }
 .account_message label,
 .account_message text{
	 font-size:30upx;
	 color:#333;
	 line-height: 35upx;
 }
 .account_message text{
	 text-overflow: ellipsis;
	 overflow: hidden;
	 white-space: nowrap;
	 display: inline-block;
	 width:200upx;
 }
 .account_message view{
	 margin:10upx 0;
 }
 .ImproveMessage button{
	 font-size:30upx;
	 color: #fff;
	 background:#f2526f;
	 width:200upx;
	 height:66upx;
	 line-height: 66upx;
	 border-radius: 33upx;
	 margin-top:30upx;
 }
 .Precautions{
	 width:95%;
	 margin:20upx auto;
 }
 .Precautions_title{
	 font-size: 32upx;
	 color:#333;
	 font-weight: bold;
 }
 .Precautions_item{
	 margin-bottom: 30upx;
 }
 ..Precautions_item rich-text{
	 margin-top: 30upx;
 }
 .Precautions_item text:nth-of-type(1){
	 font-size: 30upx;
	 color:#333;
	 display: block;
	 margin-top:30upx;
	 font-weight: 500;
 }
 .Precautions_item text:nth-of-type(2){
 	 font-size: 24upx;
 	 color:#333;
 	 display: block;
	 margin-top:20upx;
 }
 .reasonFailure label{ 
	 display: inline-block;
	 margin-left: -202upx;
 }
 .richText{
	 display: -webkit-box;
	 -webkit-box-orient: vertical;
	 -webkit-line-clamp: 3;
	 overflow: hidden;
	 text-overflow: ellipsis;
 }
 /* .reasonFailure{
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	text-overflow: ellipsis;
} */
 .AD{
 	  position: absolute;
 	  bottom: 0;
 	  left:50%;
 	  margin-left: -18%;
	 /* text-align: center;
	  margin-left: -4%;
	  margin-top:20%; */
 }
 .AD text{
 	  font-size:20upx;
 	  color:#999;
 	  margin:0 10upx;
 }
 .url button{
	 font-size: 20upx;
	 color:#999;
	 background:#fff;
	 border:1upx solid #efefef;
	 width:auto;
	 heigh:30upx;
	 display: inline-block;
	 border-radius: 30upx;
	 position: relative;
	 top:18upx;
	 left:58upx; 
 }
</style>
